<extend name="Public:form_layout" />
<block name="title"><title>修改站点</title></block>
<block name="subheader">
  <style type="text/css">
  .radio-label{ border-top:1px solid #e4e2e2; border-left:1px solid #e4e2e2}
  .radio-label td{ border-right:1px solid #e4e2e2; border-bottom:1px solid #e4e2e2;background:#f6f9fd}
  </style>
</block>
<block name="subnav">
  <a class="add fb" href="__CONTROLLER__/add"><em>添加站点</em></a>　    <a href="__CONTROLLER__/index"><em>管理站点</em></a>
</block>
<block name="main">
  <form action="__CONTROLLER__/edit?siteid=<?php echo $data['id']?>" method="post" id="myform">
    <fieldset>
      <legend>基本信息</legend>
      <table width="100%"  class="table_form">
        <tr>
          <th width="80">站点名称：</th>
          <td class="y-bg"><input type="text" class="input-text" name="info[name]" id="name" size="30" value="<?php echo $data['name']?>" /></td>
        </tr>
        <tr>
          <th>站点目录：</th>
          <td class="y-bg"><input type="text" class="input-text" name="info[dirname]" id="dirname" size="30" value="<?php echo $data['dirname']?>" /></td>
        </tr>
        <tr>
          <th>站点域名：</th>
          <td class="y-bg"><input type="text" class="input-text" name="info[domain]" id="domain"  size="30" value="<?php echo $data['domain']?>" /></td>
        </tr>
      </table>
    </fieldset>
    <div class="bk10"></div>
    <fieldset>
      <legend>SEO配置</legend>
      <table width="100%"  class="table_form">
        <tr>
          <th width="80">站点标题：</th>
          <td class="y-bg"><input type="text" class="input-text" name="info[site_title]" id="site_title" size="30" value="<?php echo $data['site_title']?>" /></td>
        </tr>
        <tr>
          <th>关键词：</th>
          <td class="y-bg"><input type="text" class="input-text" name="info[keywords]" id="keywords" size="30" value="<?php echo $data['keywords']?>" /></td>
        </tr>
        <tr>
          <th>描述：</th>
          <td class="y-bg"><input type="text" class="input-text" name="info[description]" id="description" size="30" value="<?php echo $data['description']?>" /></td>
        </tr>
      </table>
    </fieldset>
    <div class="bk10"></div>
    <fieldset>
      <legend>附件配置</legend>
      <table width="100%"  class="table_form">
        <tr>
          <th width="130" valign="top">允许上传附件大小</th>
          <td class="y-bg"><input type="text" class="input-text" name="setting[upload_maxsize]" id="upload_maxsize" size="10" value="<?php echo $setting['upload_maxsize'] ? $setting['upload_maxsize'] : '2000' ?>"/> KB </td>
        </tr>
        <tr>
          <th width="130" valign="top">允许上传附件类型</th>
          <td class="y-bg"><input type="text" class="input-text" name="setting[upload_allowext]" id="upload_allowext" size="50" value="<?php echo $setting['upload_allowext']?>"/></td>
        </tr>
        <tr>
          <th>GD库功能检测</th>
          <td class="y-bg"><?php echo check_gd(); ?></td>
        </tr>
        <tr>
          <th>是否开启图片水印</th>
          <td class="y-bg">
            <input class="radio_style" name="setting[watermark_enable]" value="1" <?php echo $setting['watermark_enable']==1 ? 'checked="checked"' : ''?> type="radio"> 启用&nbsp;&nbsp;&nbsp;&nbsp;
            <input class="radio_style" name="setting[watermark_enable]" value="0" <?php echo $setting['watermark_enable']==0 ? 'checked="checked"' : ''?> type="radio"> 关闭
          </td>
        </tr>
        <tr>
          <th>水印添加条件</th>
          <td class="y-bg">宽
            <input type="text" class="input-text" name="setting[watermark_minwidth]" id="watermark_minwidth" size="10" value="<?php echo $setting['watermark_minwidth'] ? $setting['watermark_minwidth'] : '300' ?>" /> X 高<input type="text" class="input-text" name="setting[watermark_minheight]" id="watermark_minheight" size="10" value="<?php echo $setting['watermark_minheight'] ? $setting['watermark_minheight'] : '300' ?>" /> PX
          </td>
        </tr>
        <tr>
          <th width="130" valign="top">水印图片</th>
          <td class="y-bg"><input type="text" name="setting[watermark_img]" id="watermark_img" size="30" value="<?php echo $setting['watermark_img'] ? $setting['watermark_img'] : 'mark.gif' ?>"/>水印存放路径:statics/images/water</td>
        </tr>
        <tr>
          <th width="130" valign="top">水印透明度</th>
          <td class="y-bg"><input type="text" class="input-text" name="setting[watermark_pct]" id="watermark_pct" size="10" value="<?php echo $setting['watermark_pct'] ? $setting['watermark_pct'] : '100' ?>" /> 请设置为0-100之间的数字，0代表完全透明，100代表不透明</td>
        </tr>
        <tr>
          <th width="130" valign="top">JPEG 水印质量</th>
          <td class="y-bg"><input type="text" class="input-text" name="setting[watermark_quality]" id="watermark_quality" size="10" value="<?php echo $setting['watermark_quality'] ? $setting['watermark_quality'] : '80' ?>" /> 水印质量请设置为0-100之间的数字,决定 jpg 格式图片的质量</td>
        </tr>
      </table>
    </fieldset>
    <div class="bk15"></div>
    <input type="submit" class="button" id="dosubmit" name="dosubmit" value="提交" />
  </form>
</block>
<block name="footer">
  <script type="text/javascript">
  $(function(){
    $.formValidator.initConfig({formid:"myform",autotip:true,onerror:function(msg,obj){window.top.art.dialog({content:msg,lock:true,width:'200',height:'50'}, function(){this.close();$(obj).focus();})}});
    $("#name").formValidator({
      onshow:"请输入站点名称",onfocus:"请输入站点名称"
    }).inputValidator({
      min:1,onerror:"站点名称必填"
    }).ajaxValidator({
      type : "get",
      url : "__CONTROLLER__/public_name",
      data :"siteid=<?php echo $data['id'];?>",datatype : "html",
      async:'true',
      success : function(data){
        if( data == "1" ){return true;} else { return false;}
      },
      buttons: $("#dosubmit"),
      onerror : "该站点已存在",
      onwait : "验证中"
    }).defaultPassed();

    $("#dirname").formValidator({
      onshow:"请输入站点名称，该名称为站点域名前缀",
      onfocus:"请输入站点名称，该名称为站点域名前缀"
    }).inputValidator({
      min:1,onerror:"站点名称必填"
    }).regexValidator({
      regexp:"username",
      datatype:"enum",
      param:'i',
      onerror:"只能包括数字、字母、下划线三种类型。"
    }).ajaxValidator({
      type : "get",
      url : "__CONTROLLER__/public_dirname",
      data :"siteid=<?php echo $data['id'];?>",
      datatype : "html",
      async:'false',
      success : function(data){
        if( data == "1" ){return true;}else{return false;}
      },
      buttons: $("#dosubmit"),
      onerror : "该目录已经存在",
      onwait : "验证中"
    }).defaultPassed();

    $("#domain").formValidator({
      onshow:"请填写域名，格式应该为http://www.hhailuo.com",
      onfocus:"请填写域名，格式应该为http://www.hhailuo.com",
      tipcss:{width:'300px'},
      empty:false
    }).inputValidator({
      onerror:"请填写域名，格式应该为http://www.hhailuo.com"
    }).regexValidator({
      regexp:"http:\/\/(.+)[^\/]$",
      onerror:"格式应该为http://www.hhailuo.com，请不要以‘/’结束"
    }).defaultPassed();
  })
  </script>
</block>